﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>简明教程</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="winchm_template_style.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function d_onresize(){
if (window.navigator.userAgent.indexOf("MSIE")>=1){
document.getElementById('winchm_template_content').style.pixelWidth = document.body.offsetWidth - 3;
document.getElementById('winchm_template_content').style.pixelHeight = document.body.offsetHeight - document.getElementById('winchm_template_top').offsetHeight - 4;
}
document.getElementById('winchm_template_content').style.top = document.getElementById('winchm_template_top').offsetHeight + 'px';
}

function d_onbeforeprint(){
document.getElementById('winchm_template_content').style.width = 'auto';
document.getElementById('winchm_template_content').style.height = 'auto';
}

function d_onafterprint(){
d_onresize();
}

window.onload = d_onresize;
window.onresize = d_onresize;
window.onbeforeprint = d_onbeforeprint;
window.onafterprint = d_onafterprint;
</script>
</head>

<body>

<div id="winchm_template_top">
<table width="100%" height="50" bgcolor="#c4d0f4" style="WIDTH: 100%" cellSpacing=0 cellPadding=3 border=0>
<tr>
<td>
<div id="winchm_template_navigation"><EM>New&nbsp;Help 
      &gt;&nbsp;</EM>简明教程 </div>
<div id="winchm_template_title">
简明教程</div>
</td>
<td align="right" style="WIDTH: 90px">
<IMG alt=Previous src="btn_prev_n.gif"><IMG alt=Next src="btn_next_n.gif">
</td>
</tr>
</table>
</div>
<div id="winchm_template_content">
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px"><STRONG 
style="BOX-SIZING: border-box; FONT-WEIGHT: bold">一、获取JNTemplate</STRONG></P>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px">极念模板引擎(JNTemplate 
engine)可以直接在我们的开源主页中下载得到源代码或者已经发行的DLL</P>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px">或者在VS2010及以上版本中通过NuGet下载</P>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px"><IMG 
style="BOX-SIZING: border-box; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; VERTICAL-ALIGN: middle; BORDER-TOP: 0px; BORDER-RIGHT: 0px" 
alt="" src="http://www.jiniannet.com/Attachment/20171"></P>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px"><IMG 
style="BOX-SIZING: border-box; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; VERTICAL-ALIGN: middle; BORDER-TOP: 0px; BORDER-RIGHT: 0px" 
alt="" src="http://www.jiniannet.com/Attachment/20172"></P>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px"><IMG 
style="BOX-SIZING: border-box; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; VERTICAL-ALIGN: middle; BORDER-TOP: 0px; BORDER-RIGHT: 0px" 
alt="" src="http://www.jiniannet.com/Attachment/20173"></P>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px"><IMG 
style="BOX-SIZING: border-box; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; VERTICAL-ALIGN: middle; BORDER-TOP: 0px; BORDER-RIGHT: 0px" 
alt="" src="http://www.jiniannet.com/Attachment/20174"></P>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px">&nbsp;</P>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px"><STRONG 
style="BOX-SIZING: border-box; FONT-WEIGHT: bold">二、JNtemplate配置</STRONG></P>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px">　　如果是通过NuGet下载的文件，那么所有的都已经配置好了，我们可以直接使用</P>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px">　　如果是自行下载的文件（源代码需要生成），解压后，请将JinianNet.JNTemplate.dll引入到项目中来（4.0下以版本请使用2.0文件夹中的JinianNet.JNTemplate.dll，否则使用4.0文件夹中的）</P>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px">&nbsp;</P>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px"><STRONG 
style="BOX-SIZING: border-box; FONT-WEIGHT: bold">三、Hello 
JNTemplate</STRONG></P>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px">　　新建一个aspx页面，在Page_Load中写入如下代码：</P><PRE style="BOX-SIZING: border-box; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BORDER-LEFT: rgb(204,204,204) 1px solid; PADDING-BOTTOM: 9px; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(245,245,245); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; PADDING-LEFT: 9px; PADDING-RIGHT: 9px; DISPLAY: block; FONT: 13px/1.4285 Menlo, Monaco, Consolas, 'Courier New', monospace; WORD-WRAP: break-word; WHITE-SPACE: pre-wrap; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-BREAK: break-all; BORDER-TOP: rgb(204,204,204) 1px solid; BORDER-RIGHT: rgb(204,204,204) 1px solid; WORD-SPACING: 0px; PADDING-TOP: 9px; -webkit-text-stroke-width: 0px; border-radius: 4px">JinianNet.JNTemplate.Template template = new JinianNet.JNTemplate.Template("hello,$name!");
template.Context.TempData["name"] = "JNTemplate";
template.Context.CurrentPath=@"c:\" //当前模板路径
template.Render(Response.Output);
Response.End();
</PRE>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px">按F5运行，可以看到我们的页面正确输出了 
hello JNTemplate</P>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px">我们也可以从指定文件加载模板</P><PRE style="BOX-SIZING: border-box; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BORDER-LEFT: rgb(204,204,204) 1px solid; PADDING-BOTTOM: 9px; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(245,245,245); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; PADDING-LEFT: 9px; PADDING-RIGHT: 9px; DISPLAY: block; FONT: 13px/1.4285 Menlo, Monaco, Consolas, 'Courier New', monospace; WORD-WRAP: break-word; WHITE-SPACE: pre-wrap; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-BREAK: break-all; BORDER-TOP: rgb(204,204,204) 1px solid; BORDER-RIGHT: rgb(204,204,204) 1px solid; WORD-SPACING: 0px; PADDING-TOP: 9px; -webkit-text-stroke-width: 0px; border-radius: 4px">JinianNet.JNTemplate.Template template = JinianNet.JNTemplate.Template.FromFile(@"c:\default.html",System.Text.Encoding.UTF8);
</PRE>
<P 
style="BOX-SIZING: border-box; WIDOWS: 1; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; MARGIN: 0px 0px 10px; FONT: 14px/20px Tahoma, Helvetica, Arial, 'Microsoft YaHei', 宋体, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(51,51,51); WORD-SPACING: 0px; -webkit-text-stroke-width: 0px">具体的每个标签的用法，请参考“标签参考”一栏</P>
<hr>
  <font face="Arial" color="#808080" size="1">Copyright 2003-2012 Your company 
  name</font>(Edit the text to change this template.)</div>

</body>

</html>
